<template>
  <div class='App'>
    <div class="box" @click="fn"></div>
  </div>
</template>
<script>
// 当前组件的配置项
// 立马可以提供 data（特殊）methods computed watch
export default {
  created() {
    console.log('created')
  },
  methods: {
    fn(){
      alert('你好')
    }
  }
}
</script>

<style lang="less">
.App {
  width: 400px;
  height: 400px;
  background-color: pink;
  .box {
    width: 100px;
    height: 100px;
    background-color: skyblue;
  }
}
</style>
